﻿using System.Globalization;

namespace Domain
{
    public class IntHeapItemValue : IHeapItemValue 
    {
        public int value { get; private set; }

        public IntHeapItemValue(int value)
        {
            this.value = value;
        }

        public override string ToString()
        {
            return value.ToString(CultureInfo.InvariantCulture);
        }

        public bool Equals(IntHeapItemValue other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }
            if (ReferenceEquals(this, other))
            {
                return true;
            }
            return value == other.value;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }
            return (GetType() == obj.GetType()) && Equals(obj as IntHeapItemValue);
        }
    }
}
